home *** CD-ROM | disk | FTP | other *** search
/ Amiga Packmags / NewsFlash - Issue 07 (1990-01)(UGA - 17-Bit Software)(Disk 1 of 2)[a].zip / NewsFlash - Issue 07 (1990-01)(UGA - 17-Bit Software)(Disk 1 of 2)[a].adf / doc / Alert.DOC < prev    next >
Text File  |  1988-01-19  |  2KB  |  72 lines

  1. ------------------------------------------------------------------------
  2.              Alert ... Created for UGA PD by Brian Postma
  3. ------------------------------------------------------------------------
  4. start:    move.l        4,a6        ;Execbase
  5.     lea        intname,a1    ;Library Name
  6.     jsr        -408(a6)    ;Open Library
  7.     move.l        d0,intbase    ;Library Base
  8.     lea        dosname,a1    ;Library Name
  9.     jsr        -408(a6)    ;Open Library
  10.     move.l        d0,dosbase
  11.  
  12.     move.l        dosbase,a6    ;fetch handle from current
  13.     jsr        -60(a6)        ;Output device->CLI
  14.     move.l        d0,handle    ;And save it
  15.     move.l        intbase,a6
  16.     move.l        #0,d0        ;Alert Number
  17.     move.l        #64,d1        ;Alert Height
  18.     lea        alert,a0    ;Alert Text
  19.     jsr        -90(a6)        ;Display alert
  20.     tst.b        d0        ;Left or Right Button
  21.     beq        right        ;Right Mousebutton ??
  22. left:    move.l        #lefttext,d2    ;Buffer
  23.     move.l        #el-lefttext,d3    ;Length
  24.     bra        text
  25. right:    move.l        #righttext,d2    ;Buffer
  26.     move.l        #er-righttext,d3;Length
  27. text:    move.l        handle,d1    ;Output Handle
  28.     move.l        dosbase,a6
  29.     jsr        -48(a6)        ;Write (to CLI)
  30. quit:    clr.l        d0
  31.     rts
  32. ;Vars
  33. handle:        dc.l    0
  34. dosbase:    dc.l    0
  35. intbase:    dc.l    0
  36. lefttext:    dc.b    "You pressed the LEFT mouse button",10,10
  37. el:
  38. righttext:    dc.b    "You pressed the RIGHT mouse button",10,10
  39. er:
  40. x1 = 236
  41. y1 = 16
  42. x2 = 240
  43. y2 = 32
  44. x3 = 184
  45. y3 = 48
  46. alert:    dc.b    x1/256,x1,y1,"Created for UGA PD by",0,1
  47.     dc.b    x2/256,x2,y2,"Brian Postma in 1989",0,1
  48.     dc.b    x3/256,x3,y3,"Press any mouse button to continue",0,0
  49. ; 0,1 means: there is more text coming,
  50. ; 0,0 means: end of all alert data.
  51.  
  52. intname:    dc.b    "intuition.library",0
  53. dosname:    dc.b    "dos.library",0
  54. ------------------------------------------------------------------------
  55. <Welcome>
  56.  
  57. This program demonstrates how to create your own alert-boxes. It shows
  58. how you can test which mouse button was pressed during the alert and it
  59. also shows how to display text on the CLI window.
  60.  
  61. Assemble this program with seka (type 'r<CR>' to load, 'a<CR><CR> to
  62. assemble and 'j<CR>' to start or 'wo<CR>' to save executable object
  63. file).
  64.  
  65. For comments, remarks, questions contact me:
  66.  
  67. Brian Postma
  68. J.v.Hartenstraat 51
  69. 7576VX Oldenzaal (NL)
  70. Tel:05410-14763
  71.  
  72.